package com.joyrec.util.db.redis

class AvailableDB(val db: Int)
object AvailableDB {
  private val dbSets = scala.collection.mutable.Set[Int]()

  implicit def apply(db: Int) =
    if (dbSets.contains(db))
      throw new RuntimeException(s"db$db be used")
    else {
      dbSets += db
      new AvailableDB(db)
    }
}